/*
 * sum2.cc
 *
 *  Created on: May 7, 2013
 *      Author: skipper
 */
#include<iostream>
#include<string>
#define MAXLEN 1001
using namespace std;
int
atoi(char a);
void
outputArray(int a[], int length,bool full);
void
resetArray(int sum[],int length);
int
main(int argc, char*argv[])
{
    int T, carry = 0, result;
    string a, b;
    cin >> T;
    int i=0,j=0,k=0,l=0;
    int adder1[MAXLEN] = { 0 }, adder2[MAXLEN] = { 0 }, sum[MAXLEN] = { 0 };
    for (i = 0; i < T; i++)
    {
        cout<<"Case "<<i+1<<":"<<endl;
        cin >> a >> b;
        cout<<a<<" + "<<b<<" = " ;
        int offset = MAXLEN - a.length();
        for (k = 0; k < a.length(); k++)
            adder1[k + offset] = atoi(a[k]);

        offset = MAXLEN - b.length();
        for (l = 0; l < b.length(); l++)
            adder2[l + offset] = atoi(b[l]);

        carry = 0;
        resetArray(sum,MAXLEN);
        resetArray(adder1,MAXLEN);
        resetArray(adder2,MAXLEN);
        for (j = MAXLEN-1; j >= 0; j--)
        {

            result = adder1[j] + adder2[j]+carry;
            if (result >= 10)
            {
                carry = 1;
                sum[j] = result - 10;
            }
            else
            {
                carry = 0;
                sum[j] = result;
            }

        }
        sum[0]=carry;
        outputArray(sum,MAXLEN,false);
        cout<<endl;
        if(i==T-1)
            break;
        else
            cout<<endl;
    }
}
void
resetArray(int sum[],int length)
{
    for (int i = 0; i < length; i++)
        sum[i] = 0;
}
int
atoi(char a)
{
    switch (a)
    {
        case ('0'):
            return 0;
        case ('1'):
            return 1;
        case ('2'):
            return 2;
        case ('3'):
            return 3;
        case ('4'):
            return 4;
        case ('5'):
            return 5;
        case ('6'):
            return 6;
        case ('7'):
            return 7;
        case ('8'):
            return 8;
        case ('9'):
            return 9;
    }
}
void
outputArray(int array[],int length, bool full)
{
    int start = 0;
    if (full == false)
    {
        for (int i = 0; i < length ; i++)
        {
            if (array[i] != 0)
            {
                start = i;
                break;
            }
        }
    }
    for (int i = start; i < length; i++)
    {
        cout << array[i];
    }
}
